package util

// 符号

// 符号
const (
	CRLF      = "\r\n"
	LF        = "\n"
	CR        = "\r"
	BACKSLASH = "\""
	BLANK     = " "
	SLASH     = "/"
	COMMA     = ","
	DASH      = "-"
	BRANCH    = ";"
	COLON     = ":"
	EQUAL     = "="
	ASTERISK  = "*"
	SPACE     = " "
	UNDERLINE = "_"
)

// 时间格式
const (
	DateStandard           = "2006-01-02 15:04:05"
	DateWithoutBarStandard = "20060102150405"
)

const (
	//WGS84坐标系
	WGS84 = "WGS84"
	//标准
	CivilCode             = "CivilCode"
	Online                = "1"
	Offline               = "0"
	BatchSize             = 1
	BuffSize              = 65507
	SN                    = 17430
	FILE_NAME_TIME_LIMITS = 29
	NETWORK_UDP           = "udp"
	NETWORK_TCP           = "tcp"
	FLAG_TRUE             = "1"

	FLAG_FALSE = "0"

	DeafultServer = true
	Counter       = "0"
	Status        = "1"
)

// sip协议
const (
	// SIP请求方法-RFC3261
	MethodInvite   = "INVITE"
	MethodAck      = "ACK"
	MethodBye      = "BYE"
	MethodCancel   = "CANCEL"
	MethodOptions  = "OPTIONS"
	MethodRegister = "REGISTER"

	// SIP请求方法-其他协议
	MethodPrack     = "PRACK"     // [RFC3262]
	MethodSubscribe = "SUBSCRIBE" // [RFC6665]
	MethodNotify    = "NOTIFY"    // [RFC6665]
	MethodPublish   = "PUBLISH"   // [RFC3903]
	MethodInfo      = "INFO"      // [RFC6086]
	MethodRefer     = "REFER"     // [RFC3515]
	MethodMessage   = "MESSAGE"   // [RFC3428]
	MethodUpdate    = "UPDATE"    // [RFC3311]
	MethodPing      = "PING"      // [https://tools.ietf.org/html/draft-fwmiller-ping-03]

	MessageTypeQuery    = "Query"
	MessageTypeResponse = "Response"
	MessageTypeNotify   = "Notify"

	MessageDeviceInfo   = "DeviceInfo"
	MessageKeepalive    = "Keepalive"
	MessageCatalog      = "Catalog"
	MessageRecordInfo   = "RecordInfo"
	MessageDeviceStatus = "DeviceStatus"
	MessageBroadcast    = "Broadcast"

	CmdTypeXmlBegin = "<CmdType>"
	CmdTypeXmlEnd   = "</CmdType>"

	XmlNodeBegin = "<"
	XmlNodeEnd   = ">"

	UserName  = "username"
	Digest    = "Digest"
	Realm     = "realm"
	Nonce     = "nonce"
	CNonce    = "cnonce"
	Response  = "response"
	Nc        = "nc"
	URI       = "uri"
	Algorithm = "algorithm"
	Qop       = "qop"

	NcFirst = "00000001"

	// SIP版本号
	SIPVersion = "SIP/2.0"
	// 协议类型
	SchemeSip = "sip"

	HelloSip = "welcom to my sip server"

	ArgTag    = "tag"
	ArgBranch = "branch"
	ArgRport  = "rport"

	ContentTypeXml      = "Application/MANSCDP+xml"
	ContentTypeSdp      = "application/sdp"
	ContentTypeMansrtsp = "Application/MANSRTSP"
	OK                  = "OK"
	Error               = "ERROR"
	OkCode              = 200
	MultipleChoicesCode = 300
	UnAuthorizedCode    = 401

	OverFlagChan = "over"

	XMLHeader       = "<?xml version=\"1.0\" encoding=\"%s\"?>\n"
	DeviceInfoXML   = "<?xml version=\"1.0\" encoding=\"GB2312\"?><Query><CmdType>DeviceInfo</CmdType><SN>17430</SN><DeviceID>%s</DeviceID></Query>"
	CatalogXML      = "<?xml version=\"1.0\" encoding=\"GB2312\"?><Query><CmdType>Catalog</CmdType><SN>17430</SN><DeviceID>%s</DeviceID></Query>"
	RecordInfoXML   = "<?xml version=\"1.0\" encoding=\"GB2312\"?><Query><CmdType>RecordInfo</CmdType><SN>17430</SN><DeviceID>%s</DeviceID><StartTime>%s</StartTime><EndTime>%s</EndTime><Type>all</Type></Query>"
	DeviceStatusXML = "<?xml version=\"1.0\" encoding=\"GB2312\"?><Query><CmdType>DeviceStatus</CmdType><SN>17430</SN><DeviceID>%s</DeviceID></Query>"

	KeepAliveXMl = "<?xml version=\"1.0\" encoding=\"GB2312\"?><Notify><CmdType>Keepalive</CmdType><SN>43</SN><DeviceID>%s</DeviceID><Status>OK</Status></Notify>"

	SdpPlayInfo = `v=0


o=%s 0 0 IN IP4 %s
s=Play
c=IN IP4 %s
t=0 0
m=video %d RTP/AVP 96 97 98 99
a=recvonly
a=rtpmap:96 PS/90000
a=rtpmap:98 H264/90000
a=rtpmap:97 MPEG4/90000
a=rtpmap:99 H265/90000
y=%s
`

	SdpPlayBackInfo = `v=0
o=%s 0 0 IN IP4 %s
s=Playback
u=%s:0
c=IN IP4 %s
t=%d %d
m=video %d RTP/AVP 96 97 98 99
a=recvonly
a=rtpmap:96 PS/90000
a=rtpmap:98 H264/90000
a=rtpmap:97 MPEG4/90000
a=rtpmap:99 H265/90000
y=%s
`
)
